Optimal. Leaf size=229 \[ \frac {2 d^2 (B c-A d) \tan ^{-1}\left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{a^3 f (c-d)^3 \sqrt {c^2-d^2}}-\frac {\left (A \left (2 c^2-9 c d+22 d^2\right )+B \left (3 c^2-16 c d-2 d^2\right )\right ) \cos (e+f x)}{15 f (c-d)^3 \left (a^3 \sin (e+f x)+a^3\right )}-\frac {(2 A c-7 A d+3 B c+2 B d) \cos (e+f x)}{15 a f (c-d)^2 (a \sin (e+f x)+a)^2}-\frac {(A-B) \cos (e+f x)}{5 f (c-d) (a \sin (e+f x)+a)^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.72, antiderivative size = 229, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2978, 12, 2660, 618, 204} \[ \frac {2 d^2 (B c-A d) \tan ^{-1}\left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{a^3 f (c-d)^3 \sqrt {c^2-d^2}}-\frac {\left (A \left (2 c^2-9 c d+22 d^2\right )+B \left (3 c^2-16 c d-2 d^2\right )\right ) \cos (e+f x)}{15 f (c-d)^3 \left (a^3 \sin (e+f x)+a^3\right )}-\frac {(2 A c-7 A d+3 B c+2 B d) \cos (e+f x)}{15 a f (c-d)^2 (a \sin (e+f x)+a)^2}-\frac {(A-B) \cos (e+f x)}{5 f (c-d) (a \sin (e+f x)+a)^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 204
Rule 618
Rule 2660
Rule 2978
Rubi steps
\begin {align*} \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x))^3 (c+d \sin (e+f x))} \, dx &=-\frac {(A-B) \cos (e+f x)}{5 (c-d) f (a+a \sin (e+f x))^3}-\frac {\int \frac {-a (2 A c+3 B c-5 A d)-2 a (A-B) d \sin (e+f x)}{(a+a \sin (e+f x))^2 (c+d \sin (e+f x))} \, dx}{5 a^2 (c-d)}\\ &=-\frac {(A-B) \cos (e+f x)}{5 (c-d) f (a+a \sin (e+f x))^3}-\frac {(2 A c+3 B c-7 A d+2 B d) \cos (e+f x)}{15 a (c-d)^2 f (a+a \sin (e+f x))^2}+\frac {\int \frac {a^2 \left (B c (3 c-13 d)+A \left (2 c^2-7 c d+15 d^2\right )\right )+a^2 d (2 A c+3 B c-7 A d+2 B d) \sin (e+f x)}{(a+a \sin (e+f x)) (c+d \sin (e+f x))} \, dx}{15 a^4 (c-d)^2}\\ &=-\frac {(A-B) \cos (e+f x)}{5 (c-d) f (a+a \sin (e+f x))^3}-\frac {(2 A c+3 B c-7 A d+2 B d) \cos (e+f x)}{15 a (c-d)^2 f (a+a \sin (e+f x))^2}-\frac {\left (B \left (3 c^2-16 c d-2 d^2\right )+A \left (2 c^2-9 c d+22 d^2\right )\right ) \cos (e+f x)}{15 (c-d)^3 f \left (a^3+a^3 \sin (e+f x)\right )}-\frac {\int -\frac {15 a^3 d^2 (B c-A d)}{c+d \sin (e+f x)} \, dx}{15 a^6 (c-d)^3}\\ &=-\frac {(A-B) \cos (e+f x)}{5 (c-d) f (a+a \sin (e+f x))^3}-\frac {(2 A c+3 B c-7 A d+2 B d) \cos (e+f x)}{15 a (c-d)^2 f (a+a \sin (e+f x))^2}-\frac {\left (B \left (3 c^2-16 c d-2 d^2\right )+A \left (2 c^2-9 c d+22 d^2\right )\right ) \cos (e+f x)}{15 (c-d)^3 f \left (a^3+a^3 \sin (e+f x)\right )}+\frac {\left (d^2 (B c-A d)\right ) \int \frac {1}{c+d \sin (e+f x)} \, dx}{a^3 (c-d)^3}\\ &=-\frac {(A-B) \cos (e+f x)}{5 (c-d) f (a+a \sin (e+f x))^3}-\frac {(2 A c+3 B c-7 A d+2 B d) \cos (e+f x)}{15 a (c-d)^2 f (a+a \sin (e+f x))^2}-\frac {\left (B \left (3 c^2-16 c d-2 d^2\right )+A \left (2 c^2-9 c d+22 d^2\right )\right ) \cos (e+f x)}{15 (c-d)^3 f \left (a^3+a^3 \sin (e+f x)\right )}+\frac {\left (2 d^2 (B c-A d)\right ) \operatorname {Subst}\left (\int \frac {1}{c+2 d x+c x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{a^3 (c-d)^3 f}\\ &=-\frac {(A-B) \cos (e+f x)}{5 (c-d) f (a+a \sin (e+f x))^3}-\frac {(2 A c+3 B c-7 A d+2 B d) \cos (e+f x)}{15 a (c-d)^2 f (a+a \sin (e+f x))^2}-\frac {\left (B \left (3 c^2-16 c d-2 d^2\right )+A \left (2 c^2-9 c d+22 d^2\right )\right ) \cos (e+f x)}{15 (c-d)^3 f \left (a^3+a^3 \sin (e+f x)\right )}-\frac {\left (4 d^2 (B c-A d)\right ) \operatorname {Subst}\left (\int \frac {1}{-4 \left (c^2-d^2\right )-x^2} \, dx,x,2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{a^3 (c-d)^3 f}\\ &=\frac {2 d^2 (B c-A d) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{a^3 (c-d)^3 \sqrt {c^2-d^2} f}-\frac {(A-B) \cos (e+f x)}{5 (c-d) f (a+a \sin (e+f x))^3}-\frac {(2 A c+3 B c-7 A d+2 B d) \cos (e+f x)}{15 a (c-d)^2 f (a+a \sin (e+f x))^2}-\frac {\left (B \left (3 c^2-16 c d-2 d^2\right )+A \left (2 c^2-9 c d+22 d^2\right )\right ) \cos (e+f x)}{15 (c-d)^3 f \left (a^3+a^3 \sin (e+f x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.25, size = 502, normalized size = 2.19 \[ \frac {\left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right ) \left (-\frac {60 d^2 (A d-B c) \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )^5 \tan ^{-1}\left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{\sqrt {c^2-d^2}}+20 A c^2 \sin \left (\frac {1}{2} (e+f x)\right )-2 A c^2 \sin \left (\frac {5}{2} (e+f x)\right )-10 A c^2 \cos \left (\frac {3}{2} (e+f x)\right )-75 A c d \sin \left (\frac {1}{2} (e+f x)\right )+9 A c d \sin \left (\frac {5}{2} (e+f x)\right )-15 A c d \cos \left (\frac {1}{2} (e+f x)\right )+45 A c d \cos \left (\frac {3}{2} (e+f x)\right )+145 A d^2 \sin \left (\frac {1}{2} (e+f x)\right )+15 A d^2 \sin \left (\frac {3}{2} (e+f x)\right )-22 A d^2 \sin \left (\frac {5}{2} (e+f x)\right )+75 A d^2 \cos \left (\frac {1}{2} (e+f x)\right )-95 A d^2 \cos \left (\frac {3}{2} (e+f x)\right )+15 B c^2 \sin \left (\frac {1}{2} (e+f x)\right )-3 B c^2 \sin \left (\frac {5}{2} (e+f x)\right )+15 B c^2 \cos \left (\frac {1}{2} (e+f x)\right )-15 B c^2 \cos \left (\frac {3}{2} (e+f x)\right )-85 B c d \sin \left (\frac {1}{2} (e+f x)\right )-15 B c d \sin \left (\frac {3}{2} (e+f x)\right )+16 B c d \sin \left (\frac {5}{2} (e+f x)\right )-75 B c d \cos \left (\frac {1}{2} (e+f x)\right )+65 B c d \cos \left (\frac {3}{2} (e+f x)\right )-20 B d^2 \sin \left (\frac {1}{2} (e+f x)\right )+2 B d^2 \sin \left (\frac {5}{2} (e+f x)\right )+10 B d^2 \cos \left (\frac {3}{2} (e+f x)\right )\right )}{30 a^3 f (c-d)^3 (\sin (e+f x)+1)^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.54, size = 2292, normalized size = 10.01 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.26, size = 578, normalized size = 2.52 \[ \frac {2 \, {\left (\frac {15 \, {\left (B c d^{2} - A d^{3}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (c) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )}}{{\left (a^{3} c^{3} - 3 \, a^{3} c^{2} d + 3 \, a^{3} c d^{2} - a^{3} d^{3}\right )} \sqrt {c^{2} - d^{2}}} - \frac {15 \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 45 \, A c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 45 \, A d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 15 \, B d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 30 \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 15 \, B c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 105 \, A c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 45 \, B c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 135 \, A d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 30 \, B d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 40 \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 15 \, B c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 135 \, A c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 65 \, B c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 185 \, A d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 40 \, B d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 20 \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 15 \, B c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 75 \, A c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 55 \, B c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 115 \, A d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 20 \, B d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 7 \, A c^{2} + 3 \, B c^{2} - 24 \, A c d - 11 \, B c d + 32 \, A d^{2} - 7 \, B d^{2}}{{\left (a^{3} c^{3} - 3 \, a^{3} c^{2} d + 3 \, a^{3} c d^{2} - a^{3} d^{3}\right )} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}^{5}}\right )}}{15 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.54, size = 606, normalized size = 2.65 \[ -\frac {2 d^{3} \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right ) A}{f \,a^{3} \left (c -d \right )^{3} \sqrt {c^{2}-d^{2}}}+\frac {2 d^{2} \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right ) B c}{f \,a^{3} \left (c -d \right )^{3} \sqrt {c^{2}-d^{2}}}+\frac {4 A}{f \,a^{3} \left (c -d \right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{4}}-\frac {4 B}{f \,a^{3} \left (c -d \right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{4}}-\frac {8 A}{5 f \,a^{3} \left (c -d \right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{5}}+\frac {8 B}{5 f \,a^{3} \left (c -d \right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{5}}+\frac {4 A c}{f \,a^{3} \left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {6 A d}{f \,a^{3} \left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {2 B c}{f \,a^{3} \left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}+\frac {4 B d}{f \,a^{3} \left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {16 A c}{3 f \,a^{3} \left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+\frac {20 A d}{3 f \,a^{3} \left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+\frac {4 B c}{f \,a^{3} \left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}-\frac {16 B d}{3 f \,a^{3} \left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}-\frac {2 A \,c^{2}}{f \,a^{3} \left (c -d \right )^{3} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}+\frac {6 A c d}{f \,a^{3} \left (c -d \right )^{3} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}-\frac {6 A \,d^{2}}{f \,a^{3} \left (c -d \right )^{3} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}+\frac {2 B \,d^{2}}{f \,a^{3} \left (c -d \right )^{3} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 17.18, size = 591, normalized size = 2.58 \[ \frac {2\,d^2\,\mathrm {atan}\left (\frac {\frac {d^2\,\left (A\,d-B\,c\right )\,\left (-2\,a^3\,c^3\,d+6\,a^3\,c^2\,d^2-6\,a^3\,c\,d^3+2\,a^3\,d^4\right )}{a^3\,\sqrt {c+d}\,{\left (c-d\right )}^{7/2}}-\frac {2\,c\,d^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (A\,d-B\,c\right )\,\left (a^3\,c^3-3\,a^3\,c^2\,d+3\,a^3\,c\,d^2-a^3\,d^3\right )}{a^3\,\sqrt {c+d}\,{\left (c-d\right )}^{7/2}}}{2\,A\,d^3-2\,B\,c\,d^2}\right )\,\left (A\,d-B\,c\right )}{a^3\,f\,\sqrt {c+d}\,{\left (c-d\right )}^{7/2}}-\frac {\frac {2\,\left (7\,A\,c^2+32\,A\,d^2+3\,B\,c^2-7\,B\,d^2-24\,A\,c\,d-11\,B\,c\,d\right )}{15\,\left (c-d\right )\,\left (c^2-2\,c\,d+d^2\right )}+\frac {2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (4\,A\,c^2+23\,A\,d^2+3\,B\,c^2-4\,B\,d^2-15\,A\,c\,d-11\,B\,c\,d\right )}{3\,\left (c-d\right )\,\left (c^2-2\,c\,d+d^2\right )}+\frac {2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (2\,A\,c^2+9\,A\,d^2+B\,c^2-2\,B\,d^2-7\,A\,c\,d-3\,B\,c\,d\right )}{\left (c-d\right )\,\left (c^2-2\,c\,d+d^2\right )}+\frac {2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (8\,A\,c^2+37\,A\,d^2+3\,B\,c^2-8\,B\,d^2-27\,A\,c\,d-13\,B\,c\,d\right )}{3\,\left (c-d\right )\,\left (c^2-2\,c\,d+d^2\right )}+\frac {2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (A\,c^2+3\,A\,d^2-B\,d^2-3\,A\,c\,d\right )}{\left (c-d\right )\,\left (c^2-2\,c\,d+d^2\right )}}{f\,\left (a^3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+5\,a^3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+10\,a^3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+10\,a^3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+5\,a^3\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+a^3\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________